package com.example.tccdemo.controller;

import com.example.tccdemo.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @author caryguan
 * @version V1.0
 * @Package com.example.tccdemo.controller
 * @date 2020/10/15 20:54
 */

@RestController
public class PaymentController {

    @Autowired
    private PaymentService paymentService;


    @RequestMapping("payment")
    public String payment(int userId, int orderId, BigDecimal amount) throws Exception {
        int result = paymentService.paymentMQ(userId, orderId, amount);
        return "支付结果: " + result;
    }
}